package com.atguigu.gmall.user.job;

import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author: atguigu
 * @create: 2023-07-03 16:27
 */
@Slf4j
@Component
public class UserJob {

    /**
     * 每月1号发送 信用卡账单 或者 贷款通知
     * 给会员10w个会员发送营销短信
     */
    @XxlJob("sendSms")
    public void sendSms() {
        int shardTotal = XxlJobHelper.getShardTotal();
        int shardIndex = XxlJobHelper.getShardIndex();
        log.info("总分片(执行器)数量:{}", shardTotal);
        log.info("当前执行器索引:{}", shardIndex);
    }
}
